import { createFeatureSelector, createSelector } from "@ngrx/store";
import { todoFeatureKey, State, adapter } from "../reducers/todo.reducer";
import { AppState } from "..";

const {
  selectIds,
  selectEntities,
  selectAll,
  selectTotal,
} = adapter.getSelectors();

export const selectTodo = createFeatureSelector<AppState, State>(
  todoFeatureKey
);
export const selectTodos = createSelector(selectTodo, selectAll);
